package com.cardvalue.sys.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.design.widget.TextInputLayout;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.widget.EditText;

import com.cardvalue.sys.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 意见反馈
 */
public class FeedBackActivity extends Activity {

    @Bind(R.id.your_matchcode) EditText  mYourMatchcode;
    @Bind(R.id.your_matchcode_holder) TextInputLayout mYourMatchcodeHolder;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_feed_back);
        ButterKnife.bind(this);
       /* mYourMatchcode.addTextChangedListener(new TextWatcher() {
            @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

            }

            //检测错误输入，当输入错误时，hint会变成红色并提醒
            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
                //检查实际是否匹配，由自己实现
               *//* if (TextUtils.isEmpty(charSequence.toString())) {
                    mYourMatchcodeHolder.setErrorEnabled(true);
                    mYourMatchcodeHolder.setError("请检查格式");
                    return;
                } else {
                    mYourMatchcodeHolder.setErrorEnabled(false);
                }*//*
                mYourMatchcodeHolder.setErrorEnabled(false);
            }

            @Override public void afterTextChanged(Editable editable) {

            }
        });*/
    }
}
